/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.reflection;

import java.util.Date;

/**
 * <p>Project: javaseapp - Ref3
 * <p>Powered by webrx On 2021-08-30 17:15:12
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class Ref3 {
    public static void main(String[] args) {
        var c = User.class;
        System.out.println(c.isInterface());//false
        System.out.println(c.isAnnotation());//false
        System.out.println(c.isPrimitive());//是不是基本类型 false
        System.out.println(c.getName());//cn.reflection.User
        System.out.println(c.getSimpleName());//User
        Class<?> c2 = int.class;
        System.out.println(c2.isPrimitive());//true
        System.out.println(c2.getName());//int
        System.out.println(c2.getSimpleName());//int
        System.out.println(c2.isArray());//false
        System.out.println(c2.isEnum());//false
        System.out.println(c2.isRecord());//false

        var d = new Date();
        var t = new User();
        System.out.println(c.isInstance(d));
        System.out.println(c.isInstance(t));
        System.out.println(t instanceof User);
    }
}
